class Solution
{
public:
    int unequalTriplets(vector<int> &nums)
    {
        int count = 0;
        int n = nums.size();
        for (int i = 0; i < n; ++i)
        {
            for (int j = i + 2; j < n; ++j)
            {
                for (int k = i + 1; k < j; ++k)
                {
                    if (nums[i] != nums[j] && nums[i] != nums[k] && nums[j] != nums[k])
                    {
                        ++count;
                    }
                }
            }
        }
        return count;
    }
};